<?php

namespace App\Cola\Service;

use App\Cola\Mapper\ColaBillMapper;
use App\Cola\Model\ColaBill;

/**
 * 价格统计
 * */
class ColaStatService
{

    /**
     * @var ColaBillMapper
     */
    public $mapper;


    public function __construct(ColaBillMapper $mapper)
    {
        $this->mapper = $mapper;
    }

    /**
     * 根据准确的年月日来查询时间
     * */
    public function getTotalByDate($params)
    {
        $query = $this->mapper->model;


        if (!empty($params['user_id'])) {
            $query->where('user_id', $params['user_id']);
        }
        if (!empty($params['user_id'])) {
            $query->where('user_id', $params['user_id']);
        }


//        $this->mapper->model
//            ->where('user_id', $userId)
//            ->whereYear('pay_time', $date)
//            ->where('cash_flow', $cash_flow)
//            ->count()

    }

    /**
     * 列表
     * */
    public function getTradeCateList()
    {

    }

}